package com.cjl.feign.food;

import com.cjl.common.dtos.PageDto;
import com.cjl.common.dtos.ResponseResult;
import com.cjl.food.dtos.FoodDto;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author cjl
 * @version v1.0
 * @description TODO
 * @createTime 2023/2/16 15:20
 */


@FeignClient("food-service")
public interface FoodClient {

    @ApiOperation("添加菜品")
    @PostMapping("/api/food/addFood")
    ResponseResult addFood(@RequestBody FoodDto foodDto);

    @ApiOperation("根据菜名删除菜品")
    @GetMapping("/api/food/deleteFood")
    ResponseResult deleteFood(@RequestParam("foodName") String foodName);

    @ApiOperation("修改菜品")
    @PostMapping("/api/food/modifyFood")
    ResponseResult modifyFood(@RequestBody FoodDto foodDto);


    @ApiOperation("根据菜名查询菜品")
    @GetMapping("/api/food/searchFood")
    ResponseResult searchFood(@RequestParam("foodName") String foodName);

    @ApiOperation("菜品列表")
    @PostMapping("/api/food/foodList")
    ResponseResult foodList(@RequestBody PageDto pageDto);

    @ApiOperation("根据id查询菜品")
    @GetMapping("/api/food/getFoodById")
    ResponseResult getFoodById(@RequestParam("foodId") Integer foodId);
}
